import { createRouter, createWebHistory } from "vue-router";


export default createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            name: 'Home',
            component: () => import('@/layout/index.vue'),
            redirect: '/home',
            children: [
                {
                    path: 'home',
                    name: 'home',
                    component: () => import('@/pages/home/components/home.vue')
                },
                {
                    path: 'register',
                    name: 'register',
                    component: () => import('@/pages/home/components/homeRegister.vue')
                },
                {
                    path: 'login',
                    name: 'login',
                    component: () => import('@/pages/home/components/login.vue')
                },
                {
                    path: 'order',
                    component: () => import('@/pages/order/index.vue')
                },
                {
                    path: 'progress',
                    component: () => import('@/pages/progress/index.vue')
                },
                {
                    path: 'result',
                    component: () => import('@/pages/result/index.vue')
                },
                {
                    path: 'myOrder',
                    component: () => import('@/pages/order/myOrder.vue')
                }
            ]
        },
    ],
    scrollBehavior (to, from, next) {
        return { top: 0 }
    }
})
